package com.baizhi.service.imp;

import com.baizhi.dao.AdminLogDao;
import com.baizhi.entity.AdminLog;
import com.baizhi.service.AdminLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminLogServiceImp implements AdminLogService {

    @Resource
    private AdminLogDao adminLogDao;

    @Override
    public PageInfo<AdminLog> findAll(Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<AdminLog> adminLogs=adminLogDao.selectAll();
        return new PageInfo<>(adminLogs);
    }

    @Override
    public void removeAdminLogById(Integer id) {
        adminLogDao.deleteById(id);
    }

    @Override
    public void addAdminLog(AdminLog adminLog) {
        adminLogDao.insetAdminLog(adminLog);
    }

    @Override
    public void removeAdminLogMultiple(Integer[] ids) {
        adminLogDao.deleteMultiple(ids);
    }
}
